home *** CD-ROM | disk | FTP | other *** search
- # RUFUS-Batchprogramm fr automatischen MausTausch
- # (C) 08.01.95 by Mathias Weber @ S3 - Version 2.7
- # ------------------------------------------------------------------------------
- # Konfiguration BITTE DAZU UNBEDINGT DIE ANLEITUNG LESEN!
- # ------------------------------------------------------------------------------
- infile="e:\rufus\export\infile.zip" # Dateiname des Infiles
- outfile="e:\rufus\import\outfile.zip" # Dateiname des Outfiles
- pproto="e:\cat\mt_proto.txt" # Dateiname des Protokolles
- pstrep="e:\cat\mt_strep.txt" # Dateiname des Status-Reports
- modres="atz" # Modem-Reset
- anwahl="atd0711-2368367" # Anwahlstring
- conlog="Connect to MAUS Stuttgart 3 [2368367]" # Log-Eintrag bei Connect
- anwmax=20 # Maximale Zahl der Anwahlversuche
- automt=0 # Autom. Lauf mit STANDARD-Einstellungen? (0=nein/1=ja)
- tausch=1 # STANDARD: MausTausch ausfhren? (0=nein/1=ja)
- prolis=1 # STANDARD: Programmliste downloaden? (0=nein/1=ja)
- proumf=0 # STANDARD: Umfang der Programmliste? (0=neue/1=alle)
- proein=1 # STANDARD: Einschrnkung nach Betriebssystemen? (0=nein/1=ja)
- prosys="0,4" # Gewnschte Betriebssysteme in Liste? (siehe Beschreibung)
- packer="Z" # Packverfahren fr Programmlisten? (siehe Beschreibung)
- intzmd=1 # Wird das interne ZModem von Rufus verwendet? (0=nein/1=ja)
- rufend=0 # Am Batchende Rufus beenden? (0=nein/1=ja)
- # ------------------------------------------------------------------------------
- anwver=1
- anwpau=dialpause*1000
- auslog=1
- autozmodem=on
- dialog=""
- diaant=0 # In diesem Teil nichts verndern!
- emulation=vt100
- logging=on
- nurtau=0
- subflr=0
- log "* MausTausch-Batch startet *"
- # ------------------------------------------------------------------------------
- # Titel
- # ------------------------------------------------------------------------------
- print '^[';
- print "[0;0H";
- print '^[';
- print "[J";
- print '^[';
- print "[0;7m";
- print " Batchprogramm fr automatischen MausTausch - Version 2.7 "
- print " (C) Mathias Weber @ S3 - Abbruch mit [ESC] "
- print '^[';
- print "[0m";
- gosub 67
- # ------------------------------------------------------------------------------
- # Funktionsabfrage
- # ------------------------------------------------------------------------------
- 1:
- gosub 80
- if automt=1 then 4
- alert 12,"MausTausch ausfhren?","[Auto|[Ja|[Nein"
- if status=1 then 3
- if status=2 then 2
- gosub 96
- if diaant=0 then 1
- automt=1
- auslog=1
- gosub 80
- wait 3000
- goto 4
- 2:
- tausch=0
- goto 6
- 3:
- tausch=1
- 4:
- if tausch=0 then 6
- exist outfile
- if status<>0 then 5
- dialog="Es ist noch ein altes OUTFILE vorhanden!"
- gosub 90
- goto 37
- 5:
- exist infile
- if status=0 then 6
- dialog="INFILE nicht vorhanden!"
- gosub 90
- goto 37
- 6:
- if automt=1 then 10
- gosub 80
- alert 12,"Programmliste downloaden?","[Nein|[Ja"
- prolis=status
- gosub 80
- if prolis=0 then 7
- alert 12,"Umfang der Programmliste...","[Neue|[Alle"
- proumf=status
- gosub 80
- gosub 65
- gosub 80
- 7:
- if tausch=1 then 8
- if prolis=1 then 8
- dialog="Nur einen Login durchfhren?"
- auslog=0
- goto 9
- 8:
- alert 12,"Anschlieáend ausloggen?","[Nein|[Ja"
- auslog=status
- dialog="Batch starten?"
- 9:
- gosub 80
- alert 12,dialog,"[Start|[Zurck|[Abbruch"
- if status=0 then 10
- if status=1 then 1 else 37
- # ------------------------------------------------------------------------------
- # MAUS anwhlen
- # ------------------------------------------------------------------------------
- 10:
- ringin=0
- print '^[';
- print "[5;0H";
- print " Anwahlversuch Nr. ";
- print anwver;
- print " "
- print
- print '^[';
- print "[0;1m";
- print " MAUS wird angewhlt ... "
- print
- print
- print '^[';
- print "[0;7m";
- print "--- Modem: --------------------------------------------------------------------";
- print '^[';
- print "[0;0m";
- print '^[';
- print "[11;0H";
- print '^[';
- print "[J";
- print
- send modres
- rwait 2000,"OK"
- send anwahl
- 11:
- rwait 90000,"CONNECT","BUSY","NO CARRIER","NO DIALTONE","RINGING"
- print '^[';
- print "[7;18H";
- print " "
- if status=0 then 20
- if status=1 then 12
- if status=2 then 12
- if status>2 then 14
- goto 10
- 12:
- anwver=anwver+1
- if anwver>anwmax then 16
- print '^[';
- print "[7;18H";
- print "MAUS ist zur Zeit belegt - bitte warten ..."
- print '^[';
- print "[15;0H";
- rwait anwpau,"RING"
- if status<>0 then 10
- print '^[';
- print "[7;18H";
- print "Eingehender Anruf - Whlpause von 1 Minute "
- if automt=1 then 13
- dialog="Eingehender Anruf"
- gosub 91
- if diaant=0 then 37 else 10
- 13:
- log "Eingehender Anruf - Whlpause. 1 Min."
- wait 60000
- goto 10
- 14:
- if status=4 then 15
- dialog="Kein Whlton vorhanden"
- gosub 90
- if diaant=0 then 37
- wait 5000
- goto 10
- 15:
- print '^[';
- print "[7;18H";
- print " MAUS ist frei, und wird gerufen... "
- print '^[';
- print "[15;0H";
- ringin=ringin+1
- if ringin<6 then 11
- print '^[';
- print "[7;18H";
- print " "
- dialog="MAUS ist zur Zeit offline"
- send
- gosub 90
- wait 1000
- goto 37
- 16:
- dialog="Max. Anzahl der Whlversuche erreicht!"
- gosub 91
- if diaant=0 then 37
- anwver=1
- log "Anwahl fortgesetzt"
- goto 10
- # ------------------------------------------------------------------------------
- # Einloggen in MAUS
- # ------------------------------------------------------------------------------
- 20:
- log conlog
- clear
- print '^[';
- print "[2J";
- bell 0
- print "Batchprogramm fr automatischen MausTausch - Abbruch mit ESC"
- print "------------------------------------------------------------"
- print "Connect nach ";
- print anwver;
- print " Anwahlversuch(en)"
- print
- print
- rwait 30000,"(J/N)"
- if status<>0 then 29
- wait 1000
- if nurtau=1 then 21
- send "j";
- goto 22
- 21:
- send "MausTausch";
- 22:
- rwait 6000,"Name"
- if status<>0 then 29
- wait 1000
- send F1
- 23:
- rwait 6000,"Password"
- wait 1000
- send F11
- rwait 6000,"Leertaste","alsch","MausTausch"
- if status=1 then 23
- if status=2 then 30
- wait 1000
- send " ";
- goto 30
- 29:
- dialog="Fehler bei Einlog-Prozedur"
- goto 34
- # ------------------------------------------------------------------------------
- # Verzweigung zu den Unterprogrammen, Puffer sichern
- # ------------------------------------------------------------------------------
- 30:
- if tausch=0 then 31
- gosub 40
- if subflr=1 then 34
- if nurtau=0 then 31
- gosub 71
- goto 35
- 31:
- if prolis=0 then 32
- gosub 50
- if subflr=1 then 34
- 32:
- if auslog=0 then 37
- gosub 70
- goto 35
- 34:
- gosub 90
- if automt=0 then 35
- gosub 72
- 35:
- if pproto="" then 36
- delete pproto
- save pproto
- log "Puffer gesichert"
- 36:
- clear
- if pstrep="" then 37
- send "ati2"
- wait 2000
- delete pstrep
- save pstrep
- log "Status-Report gesichert"
- 37:
- log "* MausTausch-Batch beendet *"
- if automt=1 then 38
- bell 0
- alert 2,"Batch beendet","[OK"
- 38:
- # Soll die Logdatei nach dem Batch-Ablauf wieder gelscht werden, so muá das
- # Kommentarzeichen '#' am Anfang der nchsten Zeile gelscht und der Pfad des
- # Logfiles eingegeben werden:
- # delete "e:\rufus\rufus.log"
- if rufend=0 then 39
- dtr=off
- quit
- 39:
- end
- # ------------------------------------------------------------------------------
- # Unterprogramm: MausTausch
- # ------------------------------------------------------------------------------
- 40:
- if nurtau=1 then 41
- rwait 15000,"Eingabe"
- wait 1000
- send "T";
- rwait 15000,"Protokoll"
- 41:
- wait 1000
- send "Z";
- rwait 15000,"Protokoll startet"
- if status=0 then 42
- dialog="bertragungsprotokoll startet nicht"
- goto 48
- 42:
- upload infile
- if status=0 then 43
- dialog="Fehler bei INFILE-bertragung"
- goto 48
- 43:
- rwait 300000,"**"
- if status=0 then 44
- dialog="Timeout bei OUTFILE-Empfang"
- goto 48
- 44:
- download
- if intzmd=1 then 47
- if status=0 then 47
- dialog="Fehler bei OUTFILE-bertragung"
- goto 48
- 47:
- log "MausTausch beendet"
- rwait 6000,"Leertaste"
- wait 1000
- send " ";
- goto 49
- 48:
- subflr=1
- 49:
- return
- # ------------------------------------------------------------------------------
- # Unterprogramm: Programmliste holen
- # ------------------------------------------------------------------------------
- 50:
- rwait 6000,"Eingabe"
- wait 1000
- send "P";
- rwait 6000,"Eingabe"
- wait 1000
- send "A";
- if proumf=1 then 51
- rwait 6000,"Eingabe"
- wait 1000
- send "N";
- 51:
- if proein=0 then 52
- rwait 6000,"Eingabe"
- wait 1000
- send "B";
- rwait 6000,":"
- wait 1000
- send prosys
- 52:
- rwait 6000,"Eingabe"
- wait 1000
- send "O";
- 53:
- dialog="Timeout bei Empfang der Programmliste"
- rwait 150000,"Keine","Packer:","**","loaden"
- if status<0 then 59
- if status=0 then 55
- if status=1 then 56
- if status=2 then 54
- wait 1000
- send "J";
- goto 53
- 54:
- download
- if intzmd=1 then 57
- if status=0 then 57
- dialog="Fehler bei Empfang der Programmliste"
- goto 59
- 55:
- log "Keine neuen Programme vorhanden"
- goto 58
- 56:
- wait 1000
- send packer;
- goto 53
- 57:
- log "Programmliste geladen"
- 58:
- rwait 6000,"Leertaste"
- wait 1000
- send " ";
- rwait 6000,"Eingabe"
- wait 1000
- send "Z";
- goto 60
- 59:
- subflr=1
- 60:
- return
- 65:
- if prosys="" then 66
- alert 12,"Nur die in der Konfiguration angeg.|Betriebssysteme bercksichtigen?","[Nein|[Ja"
- proein=status
- 66:
- return
- 67:
- proein=0
- if prosys="" then 68
- proein=1
- 68:
- return
- # ------------------------------------------------------------------------------
- # Unterprogramm: Ausloggen aus MAUS
- # ------------------------------------------------------------------------------
- 70:
- rwait 6000,"Eingabe"
- wait 1000
- send "S";
- rwait 6000,"aufh"
- wait 1000
- send "J";
- 71:
- gosub 74
- if status=0 then 79
- 72:
- if carrier=0 then 79
- dtr=off
- gosub 74
- if status=0 then 79
- dtr=on
- 73:
- wait 2000
- send "+++";
- wait 2000
- send "ath"
- gosub 74
- goto 79
- 74:
- rwait 20000,"NO CARRIER"
- return
- 79:
- return
- # ------------------------------------------------------------------------------
- # Unterprogramm: Statusanzeige
- # ------------------------------------------------------------------------------
- 80:
- nurtau=1
- if prolis=1 then 81
- if auslog=0 then 81 else 82
- 81:
- nurtau=0
- 82:
- if automt=0 then 83
- auslog=1
- 83:
- print '^[';
- print "[18;0H";
- print " Eingestellte Funktionen:"
- print
- print '^[';
- print "[0;1m";
- if tausch=0 then 85
- print " MausTausch ";
- if nurtau=1 then 84
- print "(normaler Login) "
- goto 85
- 84:
- print "(Tausch-Login) "
- auslog=1
- 85:
- if prolis=0 then 88
- print " ";
- if proein=0 then 86
- print "Eingeschrnkte ";
- 86:
- print "Programmliste ";
- if proumf=0 then 87
- print "(alle Prg.) "
- goto 88
- 87:
- print "(neue Prg.) "
- 88:
- if auslog=0 then 89
- print " Automatischer Logout "
- 89:
- print " "
- print " ";
- print '^[';
- print "[0;0m";
- clear
- return
- # ------------------------------------------------------------------------------
- # Unterprogramm: Fehlermeldungen / Logdatei
- # ------------------------------------------------------------------------------
- 90:
- diaant=0
- if automt=1 then 92
- bell 0
- alert 11,dialog,"[ABBRUCH"
- goto 93
- 91:
- if automt=1 then 92
- bell 0
- alert 11,dialog,"[ABBRUCH|[WEITER"
- diaant=status
- goto 93
- 92:
- print '^[';
- print "[2J";
- print
- print '^[';
- print "[0;7m";
- print "ABBRUCH: ";
- print dialog
- print '^[';
- print "[0;0m";
- print
- 93:
- log dialog
- if diaant=1 then 94
- log "Abbruch"
- goto 95
- 94:
- log "Fortsetzung"
- 95:
- return
- 96:
- if tausch=1 then 97
- if prolis=1 then 97
- diaant=0
- alert 11,"Es ist keine Funktion ausgewhlt!","[Ach so..."
- goto 98
- 97:
- diaant=1
- 98:
- return
- end